#!/usr/bin/python
# -*- coding: utf-8 -*-

'''
Introduction to Programming in Java - An Interdisciplinary Approach

All book programs ported to Python by
Scott C. King (revisionx at {gee}ma1l <dot> c0m).

All program examples pass Pylint with a perfect 10.00 score.
Pylint:  http://www.pylint.org/


# Program 1.2.4 - Leap year

Syntax:
python leapyear.py 2004


Notes:
sys is a required import here in order to use command line arguments.
https://docs.python.org/2/tutorial/stdlib.html

int(sys.argv[1]) == Integer.parseInt(args[1])

'''

import sys


def main():
    '''  Boolean test of leap year in Gregorian calendar.  '''

    year = int(sys.argv[1])
    is_leap_year = (year % 4 == 0)
    is_leap_year = is_leap_year and (year % 100 != 0)
    is_leap_year = is_leap_year or (year % 400 == 0)
    print is_leap_year

if __name__ == '__main__':
    main()
